﻿import QtQuick 2.0
import QtQuick.Controls 2.12
import QtGraphicalEffects 1.12
Popup{
    closePolicy: Popup.CloseOnEscape
    padding: 0
    signal close_All()
    background: Rectangle {
        color:      Qt.rgba(0,0,0,0)   //背景为无色
    }
    Rectangle{
        anchors.fill: parent
        color:"#AA000000"
        Rectangle{
                color: "#1F2A37"
                width: 560
                height: 326
                radius: 8
                border.width:2
                border.color:"#20FFFFFF"
                
                anchors.centerIn: parent
                
                Image{
                    x: 248
                    y:24
                    source: "qrc:/imgs/warn_3.png"
                    sourceSize.width: 64
                    sourceSize.height: 64
                }

                Rectangle{
                    width: 160
                    height: 56
                    x:96
                    y:246
                    radius: 4
                    layer.enabled: true
                    color: "#4B5563"
                    layer.effect: DropShadow {
                        transparentBorder: true
                        horizontalOffset: 4
                        verticalOffset: 4
                        spread: 0.0
                    }
                    Text {
                        anchors.centerIn: parent
                        text: qsTr("取消")
                        font.pointSize: 24
                        font.family: "Roboto"
                        color: "#FFFFFF"
                    }
                    MouseArea{
                        anchors.fill: parent
                        onClicked: {
                            close()
                        }
                    }
                }
                Rectangle{
                    width: 160
                    height: 56
                    x:328
                    y:246
                    radius: 4
                    layer.enabled: true
                    color: "#F05252"
                    layer.effect: DropShadow {
                        transparentBorder: true
                        horizontalOffset: 4
                        verticalOffset: 4
                        spread: 0.0
                    }
                    Text {
                        anchors.centerIn: parent
                        text: qsTr("关闭")
                        font.pointSize: 24
                        font.family: "Roboto"
                        color: "#FFFFFF"
                        MouseArea{
                            anchors.fill: parent
                            onClicked: {
                                close_All()
                                close()
                            }
                        }
                    }
                }
                Text {
                    y:104
                    anchors.horizontalCenter: parent.horizontalCenter
                    text: qsTr("您确定要关闭远程操作系统吗？")
                    font.pointSize: 24
                    font.family: "PingFang HK"
                    color: '#FFFFFF'
                }
                Text {
                    y:162
                    anchors.horizontalCenter: parent.horizontalCenter
                    text: qsTr("请确保车辆及周围安全")
                    font.pointSize: 24
                    font.family: "PingFang HK"
                    color: '#F05252'
                }
            }
    }
 
    enter: Transition {
        NumberAnimation { property: "opacity"; from: 0.0; to: 1.0;duration: 200}
    }
    exit:  Transition {
        NumberAnimation { property: "opacity"; from: 1.0; to: 0.0;duration: 200}
    }
}
